﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WeChatCardProxy.WebApiEntity;
using ZilLion.Service.Core.DapperWrapper;

namespace ZilLion.Service.WeChatCardProxy.Domain
{
    public class Appid_MsgRepository : Respository<Appid_Msg>, IAppid_MsgRepository
    {
        public Appid_MsgRepository()
        {
            Context = new WeChatCardProxyContext();
        }

        public void InsertAppid_Msg(Appid_Msg Msg)
        {
            this.Add(Msg);
        }

        public List<Appid_Msg> GetAppid_Msgs()
        {
           return this.GetList(
                "select * from Appid_Msg t  join Authorization_appid_Config c on c.Authorization_appid=t.Msg_appid and c.IsDelete=0 and c.IsStop=0 and t.Msg_del=0 order by t.Msg_postdate desc").ToList();
        }

        public void UpdateAppid_Msg(Appid_Msg msg)
        {
           this.Modify(msg);
        }
    }
}
